//
//  UIView+ShowJuHua.m
//  1gene
//
//  Created by 1jiyin on 16/3/24.
//  Copyright © 2016年 1jiyin. All rights reserved.
//

#import "UIView+ShowJuHua.h"
#define TargetID 199999
@implementation UIView (ShowJuHua)
-(void)showCicle:(BOOL)isShow
{
    if (isShow) {
        UIView *view=[self viewWithTag:TargetID];
        if (view==nil) {
            view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 60)];
        }
        view.tag=TargetID;
        view.backgroundColor=[UIColor grayColor];
        view.alpha=0.6;
        view.center=CGPointMake(self.center.x, 220);
        [self addSubview:view];
        
//        UIView *v1=[[UIView alloc]init];
//        v1.bounds=CGRectMake(0, 0, 100, 60);
//        v1.center=self.center;
//        v1.backgroundColor=[UIColor whiteColor];
//        [view addSubview:v1];
        UIActivityIndicatorView *indicator=[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
        indicator.frame=CGRectMake((100-50)/2.0, 5, 50, 50);
        [indicator startAnimating];
        [view addSubview:indicator];
        
        
    }else{
       UIView *view=[self viewWithTag:TargetID];
        [view removeFromSuperview];
    }
}
@end
